Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
"Cannot read" error when trying to access Object's properties

I have this JS Object that contains 3 "thread" objects each with different values. I am trying to get the values from each of the threads. I am able to print the entire json object, but I can't print individual values from them?

My code: console.log(threadArray) returns this in console: (which is perfect) enter image description here

but when I try to replace "threadArray" with "threadArray[0].threads[0]["_id" to get the first thread's ID, it says it Cannot read unknown value.

Does anybody know why?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It's because the object called "threads" is the same as "threadArray[0]" because it IS the first element in the array. You are calling the same object twice. Instead of that log, try using this one:

console.log(threadArray[0]._id);

I hope this helps! I will stay tunned so that you can tell me if it worked

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!